package org.deva.erp.base.ex;

/**
 * Project: erp<br>
 * Description: 自定义异常<br>
 * Copyright (c) 2012<br>
 * All Rights Reserved.<br>
 * @author <a href="mailto:gly420@163.com">GuanLuYong</a><br>
 */
public class ERPException extends Exception {

	private static final long serialVersionUID = 1L;

	private ERPExceptionCode exceptionCode;
	
	public ERPException() {
		super();
	}
	
	public ERPException(ERPExceptionCode exceptionCode) {
		this.exceptionCode = exceptionCode;
	}

	public ERPExceptionCode getExceptionCode() {
		return exceptionCode;
	}

	public void setExceptionCode(ERPExceptionCode exceptionCode) {
		this.exceptionCode = exceptionCode;
	}
	
	public String getDetail() {
		if(exceptionCode != null) {
			return exceptionCode.getDesc();
		}
		return "";
	}
}
